
<div>
    <h1>
        <?= ucfirst($buildingType) ?>s <a class="gallery" href="images/<?= $buildingType ?>0.jpg" rel="lightbox[<?= $buildingType ?>]"
             title="<?= ucfirst($buildingType) ?> 1">(gallery)</a>:
    </h1>
    <table>
        <tbody>
            <?php
            for ($i = 0; $i < count($buildingArray); $i++) {
                $building = $buildingArray[$i];
                if (strtolower($building->getBuildingType()) == strtolower($buildingType)) {
                    $imagePath = $building->getImagePath();
                    $name = $building->getName();
                    $phoneNumber = $building->getPhoneNumber();
                    $address = $building->getAddress();
                    $postcode = $building->getPostcode();
                    echo "<tr>
                        <td><img alt =\"$buildingType$i\" src = \"$imagePath\"></td>
                        <td>$name</td>
                        <td>$phoneNumber</td>
                        <td>$postcode $address</td>
                    </tr>";
                }
            }
            ?>
        </tbody>
    </table>
    <a href="<?= $buildingType ?>-list.php" target="_blank">Show more ...</a>
</div>